package com.sneakxy.mybase4j.platform.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.alibaba.dubbo.config.annotation.Reference;
import com.sneakxy.mybase4j.base.service.BaseService;
import com.sneakxy.mybase4j.platform.beans.Router;
import com.sneakxy.mybase4j.platform.provider.IRouterProvider;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service
public class RouterService extends BaseService<Router, String, IRouterProvider> implements IRouterService {

	@Reference(version = "1.0.0")
	@Autowired(required = false)
	@Qualifier("routerProvider")
	private IRouterProvider provider;

	@Override
	public IRouterProvider getProvider() {
		return this.provider;
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRouterService#findByAccountId(java.lang.String)
	 */
	@Override
	public List<String> findByAccountId(String account_id) {
		return this.getProvider().findByAccountId(account_id);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRouterService#updatePermIdToNull(java.lang.String)
	 */
	@Override
	public int updatePermIdToNull(String permId) {
		return this.getProvider().updatePermIdToNull(permId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.service.IRouterService#findBySearch(java.lang.String, org.springframework.data.domain.Pageable)
	 */
	@Override
	public Page<Router> findBySearch(String search, Pageable pageable) {
		return this.getProvider().findBySearch(search, pageable);
	}

}
